CC=g++ # gcc
EXEC_NAME=RSACrypt
OBJ_FILES= main.o Contact.o Agenda.o Utilisateur.o EnsUtilisateur.o ClefPrivee.o ClefPublique.o Crypter.o  Decrypter.o  InterfaceGraphique.o Loguer.o
LIBS=-L/usr/lib -lm -lgmp
INCLUDES= -I/usr/include
CFLAGS= -Wall 
# GLIB=-L /home/titouan/Bureau/RSACrypt/rsacrypt/librairies/glib-2.32.1/glib/.libs -lglib-2.0
GTK_CFLAGS = $(shell pkg-config --cflags gtk+-2.0)
GTK_LDFLAGS = $(shell pkg-config --libs gtk+-2.0)




all:$(EXEC_NAME)
$(EXEC_NAME): $(OBJ_FILES)
	$(CC) -o $(EXEC_NAME) $(CFLAGS) $(LIBS) $(OBJ_FILES) $(GTK_CFLAGS) $(GTK_LDFLAGS) 


main.o: src/main.c src/Contact.h src/Agenda.h src/Utilisateur.h src/EnsUtilisateur.h src/ClefPrivee.h src/ClefPublique.h src/Crypter.h src/Decrypter.h src/Loguer.h src/InterfaceGraphique.h 
	$(CC) $(CFLAGS) -o $@ -c src/main.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS) 


Contact.o: src/Contact.c src/Contact.h
	$(CC) $(CFLAGS) -o $@ -c src/Contact.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS) 


Agenda.o: src/Agenda.c src/Contact.h src/Agenda.h
	$(CC) $(CFLAGS) -o $@ -c src/Agenda.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)


Utilisateur.o: src/Utilisateur.c src/Utilisateur.h
	$(CC) $(CFLAGS) -o $@ -c src/Utilisateur.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)


EnsUtilisateur.o: src/EnsUtilisateur.c src/Utilisateur.h src/EnsUtilisateur.h
	$(CC) $(CFLAGS) -o $@ -c src/EnsUtilisateur.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)


ClefPrivee.o: src/ClefPrivee.c src/ClefPrivee.h src/ClefPublique.h
	$(CC) $(CFLAGS) -o $@ -c src/ClefPrivee.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)


ClefPublique.o: src/ClefPublique.c src/ClefPublique.h
	$(CC) $(CFLAGS) -o $@ -c src/ClefPublique.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)


Crypter.o: src/Crypter.c src/Crypter.h src/ClefPublique.h
	$(CC) $(CFLAGS) -o $@ -c src/Crypter.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)


Decrypter.o: src/Decrypter.c src/Decrypter.h src/ClefPrivee.h src/ClefPublique.h
	$(CC) $(CFLAGS) -o $@ -c src/Decrypter.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)

Loguer.o: src/Loguer.c src/Loguer.h
	$(CC) $(CFLAGS) -o $@ -c src/Loguer.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)

InterfaceGraphique.o: src/InterfaceGraphique.c src/InterfaceGraphique.h
	$(CC) $(CFLAGS) -o $@ -c src/InterfaceGraphique.c $(INCLUDES) $(GTK_CFLAGS) $(GTK_LDFLAGS)

clean:
	rm *.o $(EXEC_NAME)


